import React from 'react'
import {useDispatch,useSelector} from  "react-redux"
import {addNum} from "../reducers/numReducer"

export default function Home() {
    let  num  = useSelector(state=>state.numInfo.num);
    let dispatch  = useDispatch();
  return (
    <div>
        <h3>全局的数据{num}</h3>
        <button onClick={()=>{
            dispatch(addNum(200));
        }}>修改全局的数据</button>
    </div>
  )
}
